/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
}

/* 画布样式 */
#canvas {
    border: 1px solid #e5e7eb;
    cursor: crosshair;
}

/* 主题按钮样式 */
.theme-btn {
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: translateX(5px);
}

/* 节点样式 */
.node {
    cursor: move;
    user-select: none;
}

.node text {
    font-size: 14px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
    fill: white;
}

.node rect {
    rx: 8;
    ry: 8;
}

/* 连接线样式 */
.connection {
    stroke: #6b7280;
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .w-64 {
        width: 100%;
        height: auto;
    }
    
    .flex {
        flex-direction: column;
    }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
